import type { IDirective, ICustomDirectiveElement } from '@/directives';
import type { DirectiveBinding } from 'vue';
import Lazy from './core/lazy';
import loading from '@/assets/default.png';
import error from '@/assets/error.png';

const options = { loading, error };
const lazy = new Lazy(options);

const directive: IDirective = {
  mounted: lazy.add.bind(lazy),
  updated: lazy.update.bind(lazy),
  unmounted: lazy.update.bind(lazy),
};

export default directive;
